(ns mytcp.core
  (:use [net.tcp.server]))

(defn foo
  "I don't do a whole lot."
  [x]
  (println x "Hello, World!"))

;; 处理器的抽象就成了输入输出了
(defn handler [reader writer]
  (.append writer "Hello world!"))

;; 开启服务器
;; 关闭服务器只需要把这个server关闭就行
(def server
  (tcp-server
    :port 5000
    :handler (wrap-io handler)))

